package com.example.electricbicycle.controller;

import javax.servlet.annotation.WebServlet;
import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import java.io.IOException;

@WebServlet("/ClearMessageServlet")
public class ClearMessageServlet extends HttpServlet {
    protected void doGet(HttpServletRequest request, HttpServletResponse response) throws IOException {
        // 清除 session 中的消息属性
        request.getSession().removeAttribute("successMsg");
        request.getSession().removeAttribute("errorMsg");

        response.setStatus(HttpServletResponse.SC_OK);
    }
}